Repository navigation
fix(cli): apply configured API request timeout - #1621
Open
John-David Dalton (jdalton) wants to merge 1 commit into
Open
John-David Dalton (jdalton) wants to merge 1 commit into
John-David Dalton (jdalton) wants to merge 1 commit into
Conversation
Honor configured timeout for direct CLI API calls and carry it across redirects. Assisted-by: Codex:GPT-6
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Codex:GPT-6
Summary
SOCKET_CLI_API_TIMEOUTto direct query and send requests.Validation
pnpm run test:unit src/utils/api-timeout.test.mts src/utils/api-timeout.integration.test.mts(13 passed)pnpm exec tsgo --noEmit -p tsconfig.jsonNo PR template is present in
.githubin this checkout.Note
Medium Risk
Changes outbound API HTTP behavior for all configured-timeout CLI calls; misconfigured low timeouts could cut off legitimately slow responses, though unset/invalid config preserves prior no-deadline semantics for raw fetches.
Overview
Wires
SOCKET_CLI_API_TIMEOUTinto direct Socket API traffic soqueryApi/sendApiRequest(GET and POST) honor a finite positive configured deadline, while invalid values are ignored viaresolveConfiguredSocketApiTimeout.apiFetchgains an optionaltimeouton the underlyinghttps.request: when set, the client destroys the request on timeout (ETIMEDOUT), propagates that through redirects, and surfaces it on aborted idle response bodies. The global API timeout is not auto-applied to bareapiFetchcalls—only explicittimeouton those—so unset config still allows slow/streaming responses.Adds unit tests for timeout resolution and a local HTTPS integration suite (with test certs) covering GET/POST failures, idle-body abort, success within limit, unset config, raw fetch behavior, and 302/307 redirects.
Reviewed by Cursor Bugbot for commit 83a3038. Configure here.